Portable devices such as PDAs, handheld computers, digital cameras and digital music players include memory for storing data, digital images and MP3 files. Different types of memory are available for these portable devices. Conventional memory types include flash memory, mini-hard drives, mini-compact discs, and magnetic tape. However, each of these memory types has one or more of the following limitations: large physical size, low storage capacity, relatively high cost, poor robustness, slow access time and high power consumption.
Solid state diode-based one-time programmable (OTP) memory is disclosed in assignee's U.S. Ser. No. 09/875,356 filed Jun. 5, 2001. Compared to the conventional memory, the diode-based memory has a high shock tolerance, low power consumption, fast access time, moderate transfer rate, and good storage capacity. The diode-based memory can fit into a standard portable interface (e.g., PCMCIA, CF) of a portable device.
User data is written to the OTP memory in blocks. Before the blocks are written to the OTP memory, however, error correction data such as ECC code words are added. Errors can occur due to defects in the storage medium and noise in the read channels. If errors occur in the user data, the error correction data allows the errors to be corrected.
To calculate the error correction data, a full block is needed. A typical block size is 32 kilobytes.
The block size is always the same. However, data file sizes of less than one kilobyte are not uncommon. If only a few bytes of user data are to be written to the OTP memory, padding (i.e., extra bytes) may be added to the user data to reach the 32 KByte block size. Once full block size has been reached, the error correction data is generated.
Memory is wasted if the user data is padded. A more efficient approach is needed, especially where large numbers of small files are involved.